<style>
  @import "../../../static/z39pc/css/app.6689eaa302.css";
  @import "../../../static/z39pc/css/app.bb9deb9e54.css";
  @import "../../../static/z39pc/css/animate.min.css";
  @import "../../../static/z39pc/css/mycss/taskDetail.css";
  @import "../../../static/z39pc/css/mycss/task.css";
  @import "../../../static/z39pc/css/mycss/needAndAdvice.css";
  @import "//at.alicdn.com/t/font_740159_dqn9duyurxm.css";  
</style>
<template>
  <div class="task-main-container  need-and-advice">
    <div id="mainBody" class="chrome webkit win modal-open" style="overflow-x: hidden;">
      <div id="nTalk_post_hiddenElement"
           style="left: -10px; top: -10px; visibility: hidden; display: none; width: 1px; height: 1px;"></div>

      <header-nav></header-nav>

      <div id="mainContent" style="background: none;">
        <!--<template>-->
        <div class="kanban-view">
          <div class="container-left-content active">
            <div class="show-box">
              <div class="icon-right el-icon-d-arrow-right">

              </div>
            </div>
            <div class="storageBox animated RSQ_fadeInLeft" id="storageBox">

              <div id="left-box-container1">
                <el-menu class="el-menu-vertical-demo" :default-active="getActive()"  :router="true">
                  <el-menu-item index="20" @click="linkToPage('/advice')">
                    <i class="el-icon-menu"></i>
                    <span slot="title">官方项目</span>
                  </el-menu-item>
                  <el-menu-item :index="item.id+''" :key="item.id" v-for="item in projects" @click="linkToPage('/need?pid='+item.id)">
                    <i class="el-icon-menu"></i>
                    {{item.title}}
                  </el-menu-item>
                </el-menu>
              </div>

            </div>

          </div>
          <div class="container-right">
            <div class="container-right-bottom-bg"></div>
            <div class="container-right-content">

              <!-- 写右边的内容 -->
              <router-view ref="needAndAdviceChildPage" class="view" keep-alive transition transition-mode="out-in">
              </router-view>
            </div>
          </div>
        </div>
      </div>
      <!--</template>-->
    </div>

  </div>
</template>
<div id="cli_dialog_div"></div>
<div id="cli_dialog_div"></div>
<div id="cli_dialog_div"></div>
<script>
  import '../../../static/z39pc/js/jquery-2.1.0.js'
  import draggable from 'vuedraggable'
  import _ from "underscore";
  import moment from "moment";
  import headerNav from '../../components/all/header.vue'
  import api from '../../api';
  import {taskAndTag} from "../../common/mixin";
  import {mixinPc} from "../../common/mixinPc";
  import {
    mapState,
    mapActions
  } from 'vuex'

  var initPage = function (me) {
   


  }
  import store from '../../store';

  export default {
    data() {
      return {
        boxTab: 'box',
        dateMonth: new Date(),
        memberActive: false,
        boxList: [],
        projectList: [],
        memberList: [],
        todayList: [],
        todayTags: [],
        fullscreenLoading: true,
        addBtnLoading: false,
        dragItemData: '',
        showMonth: '',
        showYear: '',
        showWeek: new Date(),

        taskDoing: null,
        sortStr: "",
        todayArr: [],
        todaySort: [],
        todaySortArr: [],
        visibility: false,
        daySelect: "",
        stateAdd: false,
        taskTitle: "",
        taskDesc: "",
        nonesList: [], //收纳箱列表,
        projectId: '', //选中的项目
      };
    },
    components: {
      draggable,
      'header-nav': headerNav
    },
    mixins: [taskAndTag, mixinPc],
    computed: {

      ...mapState({
        uid: state => state.vux.uid,
        sid: state => state.vux.sid,  //websocket id
        minDate: state => state.z39.minDate,
        maxDate: state => state.z39.maxDate,
        taskAll: state => state.z39.taskAll,
        tagDic: state => state.z39.tagDic,
        taskDic: state => state.z39.taskDic,
        tagitems: state => state.z39.tagitems,
        tagitemDic: state => state.z39.tagitemDic,
        days: state => state.z39.days,
        projects: state => state.z39.projects,
        members: state => state.z39.members,
        filterState: state => state.z39.filterTaskState,
      })
    },
    watch: {},
    created() {
    },
    filters: {},

    methods: {
      getActive(){
        let pid =this.$route.query['pid'];
        if(this.$route.query['pid']) return pid.toString();
        return '20';
      },
      linkToPage: function (page) {
        this.$router.push({
          path: page
        });
        //this.$refs.needAndAdviceChildPage.initPage();
      }
    },
    mounted: function () {
      // todo 修改pid
      //store.commit('setPid', 20);
      //store.dispatch('queryAdviceOrNeed', { key: 'suggest'});
      //store.dispatch('queryAdviceOrNeed', { key: 'demand'});

//			if(this.$route.path=='/needAndAdvice'){
//				this.$router.push('/advice')
//			}
    }
  }
</script>
